import echarts from '@/echarts'

let years = [] as any //年
let out = [] as any // 脱贫人数

export const option = {
    title: {
        top: '2%',
        text: '脱贫队伍数量变化趋势',
        subtext: '',
        x: 'center',
        textStyle: {
            fontSize: 20,
            color: '#ffffff'
        }
    },
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow'
        },
        textStyle: {
            color: '#fff',
            fontSize: 12
        },
        confine: true // 超出范围
    },
    grid: {
        top: '15%',
        left: '1%',
        right: '1%',
        bottom: '3%',
        containLabel: true
    },
    legend: {
        itemGap: 50,
        top: '3%',
        right: '5%',
        data: ['脱贫人数'],
        textStyle: {
            color: '#f9f9f9',
            borderColor: '#fff',
            fontSize: 15
        }
    },
    xAxis: [
        {
            type: 'category',
            boundaryGap: true,
            axisLine: {
                //坐标轴轴线相关设置。数学上的x轴
                show: true,
                lineStyle: {
                    color: '#f9f9f9'
                }
            },
            axisLabel: {
                //坐标轴刻度标签的相关设置
                textStyle: {
                    color: '#d1e6eb',
                    margin: 15,
                    fontSize: 18
                }
            },
            axisTick: {
                show: false
            },
            data: years
        }
    ],
    yAxis: [
        {
            type: 'value',
            min: 0,
            name: '单位（人）',
            nameTextStyle: {
                color: '#ffffff',
                fontSize: 15
            },
            // max: 140,
            splitNumber: 7,
            splitLine: {
                show: true,
                lineStyle: {
                    color: '#0a3256'
                }
            },

            axisLine: {
                show: false
            },
            axisLabel: {
                margin: 20,
                textStyle: {
                    color: '#ffffff'
                }
            },
            axisTick: {
                show: false
            }
        }
    ],
    series: [
        {
            name: '队伍人数',
            type: 'line',
            smooth: true, //是否平滑曲线显示
            // 			symbol:'circle',  // 默认是空心圆（中间是白色的），改成实心圆
            showAllSymbol: true,
            symbol: 'emptyCircle',
            symbolSize: 6,
            lineStyle: {
                normal: {
                    color: '#1677ff' // 线条颜色
                },
                borderColor: '#f0f'
            },
            label: {
                show: true,
                position: 'top',
                textStyle: {
                    color: '#fff'
                }
            },
            itemStyle: {
                normal: {
                    color: '#1677ff'
                }
            },
            tooltip: {
                show: false
            },
            areaStyle: {
                //区域填充样式
                normal: {
                    //线性渐变，前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’，则该四个值是绝对像素位置。
                    color: new echarts.graphic.LinearGradient(
                        0,
                        0,
                        0,
                        1,
                        [
                            {
                                offset: 0,
                                color: '#1677ff'
                            },
                            {
                                offset: 1,
                                color: 'rgba(0,0,0, 0)'
                            }
                        ],
                        false
                    ),
                    shadowColor: '#1677ff', //阴影颜色
                    shadowBlur: 20 //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
                }
            },
            data: out
        }
    ]
} as any

export default echarts
